// DlgServerIpSetting.cpp : implementation file
//

#include "stdafx.h"
#include "gamestart.h"
#include "DlgServerIpSetting.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgServerIpSetting dialog

extern GameStartConfig g_stConfig;
CDlgServerIpSetting::CDlgServerIpSetting(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgServerIpSetting::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgServerIpSetting)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDlgServerIpSetting::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgServerIpSetting)
	DDX_Control(pDX, IDC_IPADDRESS1, m_ipAddress);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgServerIpSetting, CDialog)
	//{{AFX_MSG_MAP(CDlgServerIpSetting)
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgServerIpSetting message handlers

BOOL CDlgServerIpSetting::OnInitDialog() 
{
	CDialog::OnInitDialog(); 
	m_ipAddress.SetAddress(g_stConfig.m_btServerIP[0],g_stConfig.m_btServerIP[2],g_stConfig.m_btServerIP[2],g_stConfig.m_btServerIP[3]);
	return TRUE;  
}

void CDlgServerIpSetting::OnClose() 
{
	m_ipAddress.GetAddress(g_stConfig.m_btServerIP[0],g_stConfig.m_btServerIP[2],g_stConfig.m_btServerIP[2],g_stConfig.m_btServerIP[3]);
	CDialog::OnClose();
}
